home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / pcmagdoc.arc / MAKEBAR.DOC < prev    next >
Encoding:
Text File  |  1988-01-19  |  13.0 KB  |  277 lines

  1.           MAKEBAR                               Robert L. Hummel
  2.           Command                        1987/No. 10 (Lab Notes)
  3.  
  4.           ______________________________________________________
  5.  
  6.           Purpose:  Compiles Lotus-style menus for non-Lotus
  7.                     applications programs for use with the
  8.                     SLASHBAR.COM utility contained on this disk.
  9.  
  10.           Format:   MAKEBAR [path]input_file [path]output_file
  11.  
  12.           Remarks:  The input_file must contain the keystrokes
  13.                     needed to activate the application program's
  14.                     commands, and it must be constructed using
  15.                     the .BDF format and syntax illustrated by the
  16.                     ASCII-readable DOS.BDF file contained on this
  17.                     disk.  The output_file produced by MAKEBAR is
  18.                     a .BAR file suitable for loading as a pop-up
  19.                     window by SLASHBAR.  Maximum length of the
  20.                     compiled .BAR file is approximately 46,000
  21.                     bytes.
  22.  
  23.                     Constructing a suitable .BDF file for an
  24.                     application is not a trivial undertaking, and
  25.                     a thorough study of the original article is
  26.                     recommended, if at all possible.  The first
  27.                     step is to organize the commands needed by
  28.                     the application into a menu-tree arrangement
  29.                     similar to the DOS menu tree shown below on
  30.                     the following page.
  31.  
  32.                     The categories in the left column will appear
  33.                     on the first line of the first menu screen.
  34.                     CLS is immediately run from that screen, so
  35.                     it has no lower branches.
  36.  
  37.                                    |- COPY
  38.                       |-  FILE   --|- DIR
  39.                       |            |- ERASE
  40.                       |            |- RENAME
  41.                       |            |- TYPE
  42.                       |
  43.                       |            |- ASSIGN
  44.                       |            |            |- PARENT
  45.                       |            |- CHDIR ----|- ROOT
  46.                       |            |            |- OTHER
  47.                       |            |- FORMAT
  48.                       |-  DISK   --|- LABEL
  49.                       |            |- MKDIR
  50.                       |            |- RMDIR
  51.                       |            |- VOL
  52.                       |
  53.                       |            |- DATE
  54.                       |-  SYSTEM  -|- TIME
  55.                       |            |- PROMPT
  56.                       |            |- VER
  57.                       |
  58.                       |-  CLS
  59.  
  60.           The diagram below shows the basic structure of the
  61.           MENU...MEND blocks from which a .BDF file is
  62.           constructed.  Again, study the DOS.BDF file on this
  63.           disk.
  64.  
  65.           PROGRAM "NAME" ---------- Identification Name
  66.  
  67.           MENU NAME -----------------------------------|
  68.                OPTION    NAME,"HELP LINE" --|          |
  69.                     COMMANDS -|             |          |
  70.                        .      |-- Commands  |-- Option |
  71.                        .      |             |   Block  |
  72.                        .     -|           --|          |-- Menu
  73.                OPTION    NAME,"HELP LINE"              |   Block
  74.                     COMMANDS                           |
  75.                  .                                     |
  76.                  .                                     |
  77.                  .                                     |
  78.           MEND ----------------------------------------|
  79.  
  80.           MENU NAME----|
  81.             .          |  Additional menu
  82.             .          |--block(s) as
  83.             .          |  required
  84.           MEND---------|
  85.  
  86.           END -------- End Of File Indicator
  87.  
  88.           Precede any comments you may wish to include in a .BDF
  89.           menu file with a semicolon.  MAKEBAR ignores the
  90.           remainder of any line when it encounters the semicolon
  91.           character.  Use the {c}1 key combination to represent
  92.           the semicolon in any names or quoted strings your
  93.           application requires.
  94.  
  95.           Two types of text entries are used in menu files.  A
  96.           STRING is an entry surrounded by quotes (").  "DOS 3.1"
  97.           and "JiffyCalc Spreadsheet" are examples of valid
  98.           strings.  A string may not contain the quote character,
  99.           but you can use the {c}3 sequence to represent it in a
  100.           string.  A NAME is an entry consisting of a single
  101.           word, and must contain no spaces.  To aid readability,
  102.           separation characters may be used in names:  DO-THIS,
  103.           DO_THAT, DO$IT$NOW, are all valid.  Upper/Lower case is
  104.           preserved in strings, but names are capitalized in the
  105.           output file.
  106.  
  107.           Strings may contain any character or key combination
  108.           (except the comment and quote characters) that can be
  109.           recognized by the BIOS.  Key combinations in a BDF that
  110.           are not recognized by the BIOS will produce an error
  111.           message.  (There may therefore be some commands for a
  112.           given application that cannot be included in the menu
  113.           structure.)
  114.  
  115.           Alpha-numeric keys are entered by typing them.  All
  116.           special keys, such as the function keys and shift-key
  117.           combinations are entered in symbolic form as text
  118.           surrounded by braces.  The Shift, Ctrl, and Alt keys
  119.           affect only the immediately following key.  The
  120.           available special keys and their representation in a
  121.           .BDF file are:
  122.  
  123.           {ESC}     Escape              {U}       Arrow Up
  124.           {TAB}     Tab                 {D}       Arrow Down
  125.           {ENTER}   ENTER               {L}       Arrow Left
  126.           {BS}      Backspace           {R}       Arrow Right
  127.           {HOME}    Home                {INS}     Insert
  128.           {PGUP}    Page Up             {DEL}     Delete
  129.           {PGDN}    Page Down           {C}       Control
  130.           {END}     End                 {S}       Shift
  131.                                         {A}       Alt
  132.  
  133.           Function Keys
  134.  
  135.           {F1} {F2} {F3} {F4} {F5} {F6} {F7} {F8} {F9} {F10}
  136.  
  137.           Redundant key combinations, such as {S}a instead of A,
  138.           will produce an error message.
  139.  
  140.           Example:  To block out a paragraph in WordPerfect the
  141.                     sequence would be:
  142.  
  143.                          "{A}{F4}{ENTER}"
  144.  
  145.                     To enter the WordStar Ctrl-KD sequence (to
  146.                     end editing and save changes), you would use
  147.                     the string:
  148.  
  149.                          "{C}KD"
  150.  
  151.                     To replace the current file in 1-2-3, enter:
  152.  
  153.                          "/FSR"
  154.  
  155.           A .BDF file always begins with the word PROGRAM,
  156.           followed by a string.  The first 10 characters of the
  157.           string are encoded in the compiled .BAR file for
  158.           display in the pop-up window.  PROGRAM must be the
  159.           first non-comment line in the program, and it must
  160.           appear only once.  Conversely, END causes processing of
  161.           the input file to cease and is the last command read.
  162.           Each .BDF file must include an END.
  163.  
  164.           The remainder of the file consists of MENU-MEND blocks,
  165.           as was diagrammed above.  Each block corresponds to one
  166.           complete set of command choices.  In the DOS.BDF
  167.           example there are five menu blocks:  the top-level
  168.           block; three second level blocks (to represent the
  169.           FILE, DISK, and SYSTEM submenus); and one third level
  170.           block (the CHDIR sub-submenu).  Note that the CLS
  171.           option does not require a menu block since that command
  172.           terminates at the first level.  The MENU block that
  173.           follows the PROGRAM command is assumed to be the top
  174.           level menu and will be the first one to be executed.
  175.           Subsequent MENU blocks may be in any order.
  176.  
  177.           Each MENU statement takes a NAME as its argument, and
  178.           no two menus can have the same name.  The name is used
  179.           as a target when control is transferred between menus
  180.           with the EXECUTE command.  Using identical menu names
  181.           will cause MAKEBAR to report a Bad Menu Reference.
  182.  
  183.           The MENU block is divided into one or more OPTION
  184.           blocks.  An OPTION block comprises three separate
  185.           parts: name, help line, and commands.  While, like a
  186.           menu, each option must have a name, there are no
  187.           restrictions as to uniqueness.  The same option name
  188.           may be used in different menus with different meanings,
  189.           though this would not be the best design for a
  190.           consistent interface.  Because options may be selected
  191.           by pressing their first letter, if two options begin
  192.           with the same letter, the second option can never be
  193.           executed by pressing that letter.  (It can be invoked
  194.           by positioning the cursor and pressing ENTER.)  This
  195.           property could be used to prevent accidental use of a
  196.           command by making it more difficult to invoke.
  197.  
  198.           The help string must follow each option name on the
  199.           same line.  This string will be displayed below the
  200.           option names when that option is selected with the
  201.           cursor.  The length of this string must be less than 78
  202.           characters in order to fit within the window created by
  203.           SLASHBAR.  Beginning on the next line, the application
  204.           program commands to be executed when that option is
  205.           chosen are entered.  Each command must begin on a
  206.           separate line, and the entire command must be contained
  207.           on that line.  If more keys need to be entered than can
  208.           fit on a single line, multiple TYPE statements (see
  209.           below) can be used.
  210.  
  211.           The BDF commands, with their syntax, are listed below:
  212.  
  213.           PROGRAM "string"
  214.           END
  215.           MENU name
  216.           MEND
  217.           OPTION name, "string"
  218.           ASK "string"
  219.           INPUT
  220.           TYPE "string"
  221.           CR
  222.  
  223.           Remember that a name is a single word with no
  224.           separating spaces, and that a "string" is a series of
  225.           characters surrounded by quotes (").  The quotes symbol
  226.           itself cannot be used within a string, but it can be
  227.           represented in a string by the {c}3 sequence.
  228.  
  229.           A number of these commands have been discussed above.
  230.           The five that remain, EXECUTE, ASK, TYPE, INPUT, and
  231.           CR, may only appear inside an OPTION block.  These
  232.           commands make up a kind of batch language that controls
  233.           the operation of the SLASHBAR utility.  At the end of
  234.           each menu path is a command string that will accomplish
  235.           the desired result when fed to the applications
  236.           program, just as if you typed in the commands directly.
  237.  
  238.           The EXECUTE command transfers control down the menu
  239.           tree.  Any option may invoke another menu by executing
  240.           it.  Since menu flow is one-way, lines appearing below
  241.           an EXECUTE command within the same OPTION block will
  242.           never be invoked.  In addition, since paths in the menu
  243.           tree may not cross, two option blocks cannot execute
  244.           the same menu.  MAKEBAR checks for this and signals it
  245.           as an error.  This prevents building a circular
  246.           reference into the tree, where a menu could call itself
  247.           indefinitely.
  248.  
  249.           The ASK command is used to prompt the user for
  250.           information.  The string argument appears on the screen
  251.           in the upper half of the pop-up window and does not
  252.           affect the output keystrokes.  Because the logical use
  253.           of the ASK command is to request a reply, it is usually
  254.           followed by the INPUT command.  By using these commands
  255.           together, it is possible to solicit information to
  256.           complete a command sequence.
  257.  
  258.           The INPUT command accepts input from the keyboard and
  259.           appends it to the current command string.  The input is
  260.           buffered, and the backspace key can be used to correct
  261.           the entry.  Up to 78 characters may be entered, and
  262.           input terminates when the Enter key is pressed.  The
  263.           keys are put in the command string as they were typed
  264.           without the terminating <Enter>.
  265.  
  266.           The TYPE command copies the keys in the string argument
  267.           to the command string.  Special keys (i.e., function
  268.           keys and shift-key combinations) are stored with a
  269.           special code to indicate that they are extended ASCII.
  270.           A special case of the TYPE command is the CR command.
  271.           It is equivalent to the command
  272.  
  273.                     TYPE "{ENTER}"
  274.  
  275.           and is included simply for convenience in closing
  276.           commands after requesting an input.
  277.